Adwaita: animate check and radios
authorLapo Calamandrei <calamandrei@gmail.com>
Thu, 11 Feb 2016 17:27:25 +0000 (18:27 +0100)
committerLapo Calamandrei <calamandrei@gmail.com>
Thu, 11 Feb 2016 17:27:25 +0000 (18:27 +0100)
gtk/theme/Adwaita/_common.scss
gtk/theme/Adwaita/gtk-contained-dark.css
gtk/theme/Adwaita/gtk-contained.css

index 9892e3f00a0985032a5ae83501415eb0a96892cc..4a2dc2319c6f7f1b1b79709636109387889699e9 100644 (file)
@@ -2300,6 +2300,7 @@ radio {
       -gtk-icon-shadow: none;
       color: inherit;
       border-color: currentColor;
+      animation: none;
     }
   }
 }
@@ -2320,6 +2321,36 @@ radio {
                                             -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
 }
 
+// let's animate things
+@keyframes check_check {
+  from { -gtk-icon-transform: translate(6px, -3px) rotate(-45deg) scaleY(0.2) rotate(45deg) scaleX(0); }
+  to { -gtk-icon-transform: unset; }
+}
+
+@keyframes check_radio {
+  from { -gtk-icon-transform: scale(0); }
+  to { -gtk-icon-transform: unset; }
+}
+
+@keyframes check_indeterminate {
+  from { -gtk-icon-transform: scale(0, 1); }
+  to { -gtk-icon-transform: unset; }
+}
+
+check:not(:indeterminate):checked { animation: check_check 400ms; }
+
+radio:not(:indeterminate):checked { animation: check_radio 400ms; }
+
+check:indeterminate:checked:active, radio:indeterminate:checked { animation: check_indeterminate 400ms; }
+
+// no animations in menus
+menu menuitem {
+  check:not(:indeterminate):checked,
+  radio:not(:indeterminate):checked,
+  check:indeterminate:checked:active,
+  radio:indeterminate:checked { animation: none; }
+}
+
 
 /************
  * GtkScale *
index cfc20dff1a827f07de67a4e4e20e18954b8a1f1f..687a82ce459b186e9a5047f031ab7e2e4b45eefb 100644 (file)
@@ -2870,7 +2870,8 @@ radio {
     box-shadow: none;
     -gtk-icon-shadow: none;
     color: inherit;
-    border-color: currentColor; }
+    border-color: currentColor;
+    animation: none; }
 
 check {
   border-radius: 3px; }
@@ -2886,6 +2887,36 @@ radio {
   radio:indeterminate {
     -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")), -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
 
+@keyframes check_check {
+  from {
+    -gtk-icon-transform: translate(6px, -3px) rotate(-45deg) scaleY(0.2) rotate(45deg) scaleX(0); }
+  to {
+    -gtk-icon-transform: unset; } }
+@keyframes check_radio {
+  from {
+    -gtk-icon-transform: scale(0); }
+  to {
+    -gtk-icon-transform: unset; } }
+@keyframes check_indeterminate {
+  from {
+    -gtk-icon-transform: scale(0, 1); }
+  to {
+    -gtk-icon-transform: unset; } }
+check:not(:indeterminate):checked {
+  animation: check_check 400ms; }
+
+radio:not(:indeterminate):checked {
+  animation: check_radio 400ms; }
+
+check:indeterminate:checked:active, radio:indeterminate:checked {
+  animation: check_indeterminate 400ms; }
+
+menu menuitem check:not(:indeterminate):checked,
+menu menuitem radio:not(:indeterminate):checked,
+menu menuitem check:indeterminate:checked:active,
+menu menuitem radio:indeterminate:checked {
+  animation: none; }
+
 /************
  * GtkScale *
  ************/
index dfd27bf2f2fb642e5df6dec7f8d1eb321b1f42f2..a1907954e4f3ec89c886825f7257116ae2062c6b 100644 (file)
@@ -3003,7 +3003,8 @@ radio {
     box-shadow: none;
     -gtk-icon-shadow: none;
     color: inherit;
-    border-color: currentColor; }
+    border-color: currentColor;
+    animation: none; }
 
 check {
   border-radius: 3px; }
@@ -3019,6 +3020,36 @@ radio {
   radio:indeterminate {
     -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")), -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
 
+@keyframes check_check {
+  from {
+    -gtk-icon-transform: translate(6px, -3px) rotate(-45deg) scaleY(0.2) rotate(45deg) scaleX(0); }
+  to {
+    -gtk-icon-transform: unset; } }
+@keyframes check_radio {
+  from {
+    -gtk-icon-transform: scale(0); }
+  to {
+    -gtk-icon-transform: unset; } }
+@keyframes check_indeterminate {
+  from {
+    -gtk-icon-transform: scale(0, 1); }
+  to {
+    -gtk-icon-transform: unset; } }
+check:not(:indeterminate):checked {
+  animation: check_check 400ms; }
+
+radio:not(:indeterminate):checked {
+  animation: check_radio 400ms; }
+
+check:indeterminate:checked:active, radio:indeterminate:checked {
+  animation: check_indeterminate 400ms; }
+
+menu menuitem check:not(:indeterminate):checked,
+menu menuitem radio:not(:indeterminate):checked,
+menu menuitem check:indeterminate:checked:active,
+menu menuitem radio:indeterminate:checked {
+  animation: none; }
+
 /************
  * GtkScale *
  ************/